<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <table cellspacing="0" cellpadding="0" border="0" class="layui-table" lay-filter="table" id="table">
                <span>订单号: <?=$info['order_no']?></span>
                <tbody>
                    <tr>
                        <td>开户行</td>
                        <td>
                            <?=$info['bank_name']?>
                        </td>


                        <td>开户名</td>
                        <td>
                            <?=$info['bank_username']?>
                        </td>

                        <td>银行卡号</td>
                        <td>
                            <?=$info['bank_no']?>
                        </td>

                    </tr>
                    <tr>
                         <td>提现金额</td>
                        <td>
                            <?=$info['money']?>
                        </td>

                        <td>手续费</td>
                        <td>
                            <?=$info['fee']?>
                        </td>


                        <td>实际到账金额</td>
                        <td>
                            <?=$info['real_money']?>
                        </td>
                    </tr>
                     <tr>
                        <td>状态</td>
                        <td>
                            <?=c('type.withdraw_status')[$info['status']]?>
                        </td>

                        <td>审核备注</td>
                        <td>
                            <?=$info['shenhe_status_note']?>
                        </td>
                        <td></td>
                        <td>
                        </td>
                    </tr>
                    <?php if($info['daifa_type']==1){ ?>
                        <tr>
                            <td>批次号</td>
                            <td>
                                <?=$info['daifa_number']?>
                            </td>
                            <td>代发状态</td>
                            <td>
                                <?=c('type.daifa_status')[$info['daifa_status']]?>
                            </td>
                            <td>代发备注</td>
                            <td>
                                <?=$info['daifa_note']?>
                            </td>
                        </tr>
                    <?php }?>
                        <tr>
                            <td>代发方式</td>
                            <td>
                                <?=c('type.daifa_type')[$info['daifa_type']]?>
                            </td>
                            <td>申请时间</td>
                            <td>
                                <?=com_time_format($info['create_time'])?>
                            </td>
                            <td>代发时间</td>
                            <td>
                                <?=com_time_format($info['daifa_time'])?>
                            </td>
                        </tr>
                </tbody>
            </table>

            <?php if($info['daifa_type']==0 && $info['shenhe_status']==2 && $info['daifa_status']==0){ ?>
            <table cellspacing="0" cellpadding="0" border="0" class="layui-table mt-10" lay-filter="table" id="table">
                <tbody>
                    <div class="layui-fluid">
                        <div class="layui-card">
                          <div class="layui-card-body">
                            <form class="layui-form" onsubmit="return false;">
                                <div class="layui-form-item">
                                  <label class="layui-form-label">代发结果</label>
                                  <div class="layui-input-block">
                                    <select name="status" >
                                        <option value="">选择代发结果</option>
                                        <option value="2">成功</option>
                                        <option value="1">失败</option>
                                    </select>
                                  </div>
                                </div>
                                <div class="layui-form-item">
                                  <label class="layui-form-label">备注</label>
                                  <div class="layui-input-block">
                                    <input type="text" name="note" value="" autocomplete="off" class="layui-input">
                                  </div>
                                </div>
                              <div class="layui-form-item">
                                <div class="layui-input-block">
                                  <button class="layui-btn" id="tijiao">立即提交</button>
                                </div>
                              </div>
                            </form>
                          </div>
                        </div>
                    </div>
                </tbody>
            </table>
            <?php } ?>
        </div>
    </div>
</div>

<script>
layui.use(['table','form','larry'], function(){
    var form = layui.form;
    var table = layui.table;
    var $ = layui.$;
    var larry = layui.larry;
    form.render('select');

    $('#tijiao').click(function(event) {
        var status   = $('[name="status"]').val();
        var note = $('[name="note"]').val();
        var id = '<?=$info["id"]?>';
        var url     = "<?=url('daifa/shenhe')?>";
        var params  = { status:status,note:note,id:id };

        if ( status=='' ) { layer.msg('请选择审核状态',{icon:5});return; }

        if (status==2) { var msg = '通过';}
        if (status==1) { var msg = '拒绝';}

        //询问框
        layer.confirm('您确定要审核'+msg+'该笔订单？', {
            btn: ['确定','取消']
        }, function(index){
            index = layer.load(2, {shade: [0.1,'#fff']});
            $.ajax({
                url: url,
                type: 'POST',
                dataType: "json",
                data:params,
                success:function(rs){
                    my.action(rs);
                },
                error:function(){
                    layer.msg('服务器开小差了,请联系管理员');
                },
                complete: function(){
                    layer.close(index);
                }
            });
        });
    })
})
</script>
